home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / Classes / 2.0_NumberLine / drawLine.psw < prev    next >
Encoding:
Text File  |  1992-06-10  |  16.4 KB  |  799 lines

  1. // By Judy D. Halchin, Educational Computing Services, Allegheny College.
  2. // You may freely copy, distribute and reuse this code. 
  3. // Allegheny College and the author disclaim any warranty of any kind, 
  4. // expressed or implied, as to its fitness for any particular use.
  5. // This work was partially supported by a Teacher Preparation grant from the 
  6. // National Science Foundation.
  7.  
  8. defineps drawBorders(float width, height, linePosition, borderWidth,         
  9.                      backgroundGray, lineGray; boolean vertical, endBars)
  10.  
  11. % width and height are unscaled here to get linewidths right
  12.  
  13. gsave
  14.  
  15. % background
  16. backgroundGray setgray
  17. 1 setalpha
  18. 0 0 width height  rectfill
  19.  
  20. % draw border if it should have one
  21. borderWidth 0 ge
  22. {
  23.    % offsets to avoid part of the border being clipped off
  24.    borderWidth 0 eq 
  25.       {/border 1 def} 
  26.       {/border borderWidth def}
  27.    ifelse
  28.    
  29.    /offset border 2 div def
  30.    /rightedge width offset sub def
  31.    /topedge height offset sub def
  32.    /bottomedge offset def
  33.    /leftedge offset def
  34.  
  35.    % draw horizontal borders
  36.    0 bottomedge moveto
  37.    width 0 rlineto
  38.    0 topedge moveto
  39.    width 0 rlineto
  40.  
  41.    % draw vertical borders
  42.    leftedge 0 moveto
  43.    0 height  rlineto
  44.    rightedge 0 moveto
  45.    0 height rlineto
  46.    
  47.    borderWidth setlinewidth
  48.    0 setgray
  49.    stroke
  50. } if
  51.  
  52. % draw end bars, if it should have them
  53. endBars
  54. {
  55.    vertical
  56.    {
  57.       width linePosition sub 7 sub    1 moveto
  58.       15 0 rlineto
  59.       -15 height 1 sub rmoveto
  60.       15 0 rlineto
  61.    }
  62.    {
  63.       0 linePosition 8 sub moveto
  64.       0 15 rlineto
  65.       width 1 sub -15 rmoveto
  66.       0 15 rlineto
  67.    } ifelse
  68.    
  69.    0 setlinewidth
  70.    lineGray setgray
  71.    stroke
  72. } if
  73.  
  74. grestore
  75.  
  76. endps
  77.  
  78.  
  79.  
  80. defineps drawLine(float originX, originY, width, height, scaleFactor;
  81.                         boolean vertical; float lineGray)
  82.  
  83. % originX, originY, width, height are all scaled
  84.  
  85. gsave
  86.  
  87. % scale and translate to match number line, rotate if vertical
  88. vertical 
  89. {
  90.     90 rotate   
  91.     scaleFactor 1 scale
  92.     0 height neg translate
  93. {
  94.     scaleFactor 1 scale
  95. ifelse
  96.  
  97. originX neg  originY neg translate 
  98.  
  99. % draw the line itself
  100. originX 0 moveto
  101. width 0 rlineto
  102. lineGray setgray
  103. 0 setlinewidth
  104. stroke
  105.  
  106. grestore
  107.  
  108. endps
  109.  
  110.  
  111. defineps drawTicks(float originX, originY, height, scaleFactor; 
  112.                     boolean vertical; float lineGray, firstTick, tickSpacing, 
  113.                     firstLabel, labelSpacing; int numberOfTicks)
  114.  
  115. gsave
  116.  
  117. % scale and translate to match number line, rotate if vertical
  118. vertical 
  119. {
  120.     90 rotate   
  121.     scaleFactor 1 scale
  122.     0 height neg translate
  123. {
  124.     scaleFactor 1 scale
  125. ifelse
  126.  
  127. originX neg  originY neg translate 
  128.  
  129. % draw the ticks to the left of the first label
  130. firstLabel labelSpacing sub
  131. firstTick gt 
  132.   {  /firstlabel   firstLabel labelSpacing sub   def  } 
  133.   {  /firstlabel   firstLabel  def  }
  134. ifelse
  135.  
  136. /margin    tickSpacing 3 div   def
  137. /tickCount 0 def
  138. firstTick -4 moveto
  139. {
  140.    currentpoint pop    
  141.    margin add
  142.    firstlabel gt {exit} if
  143.    
  144.    0 7 rlineto
  145.    /tickCount tickCount 1 add def
  146.    tickSpacing -7 rmoveto
  147. } loop
  148.           
  149. % draw rest of the ticks, with each fifth one larger
  150. /counter 5 def
  151. {
  152.      counter 5 eq
  153.      {
  154.         0 -4 rmoveto
  155.         0 15 rlineto
  156.         tickSpacing -11 rmoveto
  157.         /counter 0 def
  158.      }
  159.      {
  160.          0 7 rlineto
  161.         tickSpacing -7 rmoveto
  162.      } ifelse
  163.      
  164.      /counter counter 1 add def
  165.      /tickCount tickCount 1 add def
  166.      tickCount numberOfTicks eq
  167.      { exit } if
  168. } loop
  169.      
  170. lineGray setgray
  171. 0 setlinewidth
  172. 1 setalpha
  173. stroke
  174.  
  175. grestore
  176.  
  177. endps
  178.  
  179.  
  180. defineps drawHorzLabels(float originX, originY, scaleFactor, unscaleFactor; 
  181.                     int labelPosition; float labelGray, firstLabel, 
  182.                     labelSpacing; boolean scientific; int numberOfLabels; 
  183.                     char *label1, *label2, *label3, *label4, *label5, *label6,
  184.                     *label7, *label8, *label9, *label10, *label11, *exponent1,
  185.                     *exponent2, *exponent3, *exponent4, *exponent5,
  186.                     *exponent6, *exponent7, *exponent8, *exponent9,
  187.                     *exponent10, *exponent11)
  188.  
  189. gsave
  190.  
  191. %scale and translate to match the number line
  192. scaleFactor 1 scale
  193. originX neg   originY neg translate 
  194.  
  195. % set up the font 
  196. /Helvetica findfont
  197. 10 scalefont
  198. setfont
  199. labelGray setgray
  200.  
  201. % set the height for the labels
  202. labelPosition 1 eq
  203.   {      /labelHeight -18 def  }
  204.   {   /labelHeight  10 def  }
  205. ifelse
  206.     
  207. % draw the labels
  208.  
  209.     /notZero   (label1) (0) ne   def
  210.     firstLabel labelHeight moveto
  211.      unscaleFactor 1 scale
  212.        notZero 
  213.        {
  214.           (label1) stringwidth pop 
  215.           scientific notZero and {(x10  ) stringwidth pop add} if
  216.           2 div neg  0 rmoveto
  217.        } 
  218.        {-3 0 rmoveto} ifelse
  219.        (label1) show
  220.        scientific notZero and
  221.        {
  222.           2 0 rmoveto
  223.           (x) show
  224.           1 0 rmoveto
  225.           (10) show
  226.           1 5 rmoveto
  227.           (exponent1) show
  228.        } if
  229.      scaleFactor 1 scale
  230.  
  231.     /notZero   (label2) (0) ne   def
  232.     firstLabel labelSpacing add   labelHeight moveto
  233.      unscaleFactor 1 scale
  234.        notZero 
  235.        {
  236.           (label2) stringwidth pop 
  237.           scientific notZero and {(x10  ) stringwidth pop add} if
  238.           2 div neg  0 rmoveto
  239.        } 
  240.        {-3 0 rmoveto} ifelse
  241.        
  242.        (label2) show
  243.        scientific notZero and 
  244.        {
  245.           2 0 rmoveto
  246.           (x) show
  247.           1 0 rmoveto
  248.           (10) show
  249.           1 5 rmoveto
  250.           (exponent2) show
  251.        } if
  252.      scaleFactor 1 scale
  253.  
  254.     /notZero   (label3) (0) ne   def
  255.     firstLabel labelSpacing add labelSpacing add   labelHeight moveto
  256.      unscaleFactor 1 scale
  257.        notZero 
  258.        {
  259.           (label3) stringwidth pop 
  260.           scientific notZero and {(x10  ) stringwidth pop add} if
  261.           2 div neg  0 rmoveto
  262.        } 
  263.        {-3 0 rmoveto} ifelse
  264.        (label3) show
  265.        scientific notZero and
  266.        {
  267.           2 0 rmoveto
  268.           (x) show
  269.           1 0 rmoveto
  270.           (10) show
  271.           1 5 rmoveto
  272.           (exponent3) show
  273.        } if
  274.      scaleFactor 1 scale
  275.  
  276.     /notZero   (label4) (0) ne   def
  277.     numberOfLabels 4 ge
  278.     {
  279.        firstLabel labelSpacing 3 mul add   labelHeight moveto
  280.         unscaleFactor 1 scale
  281.           notZero 
  282.           {
  283.              (label4) stringwidth pop 
  284.              scientific notZero and {(x10  ) stringwidth pop add} if
  285.              2 div neg  0 rmoveto
  286.           } 
  287.           {-3 0 rmoveto} ifelse
  288.           (label4) show
  289.        scientific notZero and
  290.        {
  291.           2 0 rmoveto
  292.           (x) show
  293.           1 0 rmoveto
  294.           (10) show
  295.           1 5 rmoveto
  296.           (exponent4) show
  297.        } if
  298.         scaleFactor 1 scale
  299.     } if
  300.     
  301.     /notZero   (label5) (0) ne   def
  302.     numberOfLabels 5 ge
  303.     {
  304.        firstLabel labelSpacing 4 mul add   labelHeight moveto
  305.         unscaleFactor 1 scale
  306.           notZero 
  307.           {
  308.              (label5) stringwidth pop 
  309.              scientific notZero and {(x10  ) stringwidth pop add} if
  310.              2 div neg  0 rmoveto
  311.           } 
  312.           {-3 0 rmoveto} ifelse
  313.           (label5) show
  314.        scientific notZero and
  315.        {
  316.           2 0 rmoveto
  317.           (x) show
  318.           1 0 rmoveto
  319.           (10) show
  320.           1 5 rmoveto
  321.           (exponent5) show
  322.        } if
  323.         scaleFactor 1 scale
  324.     } if
  325.     
  326.     /notZero   (label6) (0) ne   def
  327.     numberOfLabels 6 ge
  328.     {
  329.        firstLabel labelSpacing 5 mul add   labelHeight moveto
  330.         unscaleFactor 1 scale
  331.           notZero 
  332.           {
  333.              (label6) stringwidth pop 
  334.              scientific notZero and {(x10  ) stringwidth pop add} if
  335.              2 div neg  0 rmoveto
  336.           } 
  337.           {-3 0 rmoveto} ifelse
  338.           (label6) show
  339.        scientific notZero and
  340.        {
  341.           2 0 rmoveto
  342.           (x) show
  343.           1 0 rmoveto
  344.           (10) show
  345.           1 5 rmoveto
  346.           (exponent6) show
  347.        } if
  348.         scaleFactor 1 scale
  349.     } if
  350.     
  351.     /notZero   (label7) (0) ne   def
  352.     numberOfLabels 7 ge
  353.     {
  354.        firstLabel labelSpacing 6 mul add   labelHeight moveto
  355.         unscaleFactor 1 scale
  356.           notZero 
  357.           {
  358.              (label7) stringwidth pop 
  359.              scientific notZero and {(x10  ) stringwidth pop add} if
  360.              2 div neg  0 rmoveto
  361.           } 
  362.           {-3 0 rmoveto} ifelse
  363.           (label7) show
  364.        scientific notZero and
  365.        {
  366.           2 0 rmoveto
  367.           (x) show
  368.           1 0 rmoveto
  369.           (10) show
  370.           1 5 rmoveto
  371.           (exponent7) show
  372.        } if
  373.         scaleFactor 1 scale
  374.     } if
  375.     
  376.     /notZero   (label8) (0) ne   def
  377.     numberOfLabels 8 ge
  378.     {
  379.        firstLabel labelSpacing 7 mul add   labelHeight moveto
  380.         unscaleFactor 1 scale
  381.           notZero 
  382.           {
  383.              (label8) stringwidth pop 
  384.              scientific notZero and {(x10  ) stringwidth pop add} if
  385.              2 div neg  0 rmoveto
  386.           } 
  387.           {-3 0 rmoveto} ifelse
  388.           (label8) show
  389.        scientific notZero and
  390.        {
  391.           2 0 rmoveto
  392.           (x) show
  393.           1 0 rmoveto
  394.           (10) show
  395.           1 5 rmoveto
  396.           (exponent8) show
  397.        } if
  398.         scaleFactor 1 scale
  399.     } if
  400.     
  401.     /notZero   (label9) (0) ne   def
  402.     numberOfLabels 9 ge
  403.     {
  404.        firstLabel labelSpacing 8 mul add   labelHeight moveto
  405.         unscaleFactor 1 scale
  406.           notZero 
  407.           {
  408.              (label9) stringwidth pop 
  409.              scientific notZero and {(x10  ) stringwidth pop add} if
  410.              2 div neg  0 rmoveto
  411.           } 
  412.           {-3 0 rmoveto} ifelse
  413.           (label9) show
  414.        scientific notZero and
  415.        {
  416.           2 0 rmoveto
  417.           (x) show
  418.           1 0 rmoveto
  419.           (10) show
  420.           1 5 rmoveto
  421.           (exponent9) show
  422.        } if
  423.         scaleFactor 1 scale
  424.     } if
  425.     
  426.     /notZero   (label10) (0) ne   def
  427.     numberOfLabels 10 ge
  428.     {
  429.        firstLabel labelSpacing 9 mul add   labelHeight moveto
  430.         unscaleFactor 1 scale
  431.           notZero 
  432.           {
  433.              (label10) stringwidth pop 
  434.              scientific notZero and {(x10  ) stringwidth pop add} if
  435.              2 div neg  0 rmoveto
  436.           } 
  437.           {-3 0 rmoveto} ifelse
  438.           (label10) show
  439.        scientific notZero and
  440.        {
  441.           2 0 rmoveto
  442.           (x) show
  443.           1 0 rmoveto
  444.           (10) show
  445.           1 5 rmoveto
  446.           (exponent10) show
  447.        } if
  448.         scaleFactor 1 scale
  449.     } if
  450.     
  451.     /notZero   (label11) (0) ne   def
  452.     numberOfLabels 11 ge
  453.     {
  454.        firstLabel labelSpacing 10 mul add   labelHeight moveto
  455.         unscaleFactor 1 scale
  456.           notZero 
  457.           {
  458.              (label11) stringwidth pop 
  459.              scientific notZero and {(x10  ) stringwidth pop add} if
  460.              2 div neg  0 rmoveto
  461.           } 
  462.           {-3 0 rmoveto} ifelse
  463.           (label11) show
  464.        scientific notZero and
  465.        {
  466.           2 0 rmoveto
  467.           (x) show
  468.           1 0 rmoveto
  469.           (10) show
  470.           1 5 rmoveto
  471.           (exponent11) show
  472.        } if
  473.         scaleFactor 1 scale
  474.     } if
  475.     
  476. grestore
  477.  
  478. endps
  479.  
  480.  
  481.  
  482. defineps drawVertLabels(float originX, originY, height, scaleFactor, 
  483.                     unscaleFactor; int labelPosition; float labelGray, 
  484.                     firstLabel, labelSpacing; boolean scientific; int 
  485.                     numberOfLabels; 
  486.                     char *label1, *label2, *label3, *label4, *label5, *label6,
  487.                     *label7, *label8, *label9, *label10, *label11, *exponent1,
  488.                     *exponent2, *exponent3, *exponent4, *exponent5,
  489.                     *exponent6, *exponent7, *exponent8, *exponent9,
  490.                     *exponent10, *exponent11)
  491.  
  492. gsave
  493.  
  494. % scale and translate to match number line, but don't rotate
  495. 1 scaleFactor scale
  496. height originY add  originX neg translate 
  497.  
  498. % set up the font 
  499. /Helvetica findfont
  500. 10 scalefont
  501. setfont
  502. labelGray setgray
  503.  
  504. % set the x coordinate for the labels
  505. labelPosition 1 eq
  506.   {      /labelPlace  -10 def  }
  507.   {   /labelPlace   10 def  }
  508. ifelse
  509.     
  510. % draw the labels
  511.  
  512.     /notZero   (label1) (0) ne   def
  513.      labelPlace firstLabel moveto
  514.      1 unscaleFactor scale
  515.         labelPosition 1 eq 
  516.         {
  517.           (label1) stringwidth pop 
  518.            scientific notZero and {(x10   ) stringwidth pop add} if
  519.           neg
  520.        }
  521.        {0} ifelse
  522.        -3 rmoveto
  523.        (label1) show
  524.        scientific notZero and
  525.        {
  526.           2 0 rmoveto
  527.           (x) show
  528.           1 0 rmoveto
  529.           (10) show
  530.           1 5 rmoveto
  531.           (exponent1) show
  532.        } if
  533.      1 scaleFactor scale
  534.  
  535.     /notZero   (label2) (0) ne   def
  536.     labelPlace firstLabel labelSpacing add  moveto
  537.      1 unscaleFactor scale
  538.         labelPosition 1 eq 
  539.         {
  540.           (label2) stringwidth pop 
  541.            scientific notZero and {(x10   ) stringwidth pop add} if
  542.           neg
  543.        }
  544.        {0} ifelse
  545.        -3 rmoveto
  546.        (label2) show
  547.        scientific notZero and
  548.        {
  549.           2 0 rmoveto
  550.           (x) show
  551.           1 0 rmoveto
  552.           (10) show
  553.           1 5 rmoveto
  554.           (exponent2) show
  555.        } if
  556.      1 scaleFactor scale
  557.  
  558.     /notZero   (label3) (0) ne   def
  559.     labelPlace firstLabel labelSpacing add labelSpacing add moveto
  560.      1 unscaleFactor scale
  561.         labelPosition 1 eq 
  562.         {
  563.           (label3) stringwidth pop 
  564.            scientific notZero and {(x10   ) stringwidth pop add} if
  565.           neg
  566.        }
  567.        {0} ifelse
  568.        -3 rmoveto
  569.        (label3) show
  570.        scientific notZero and
  571.        {
  572.           2 0 rmoveto
  573.           (x) show
  574.           1 0 rmoveto
  575.           (10) show
  576.           1 5 rmoveto
  577.           (exponent3) show
  578.        } if
  579.      1 scaleFactor scale
  580.  
  581.     /notZero   (label4) (0) ne   def
  582.     numberOfLabels 4 ge
  583.     {
  584.        labelPlace firstLabel labelSpacing 3 mul add  moveto
  585.         1 unscaleFactor scale
  586.         labelPosition 1 eq 
  587.         {
  588.           (label4) stringwidth pop 
  589.            scientific notZero and {(x10   ) stringwidth pop add} if
  590.           neg
  591.        }
  592.        {0} ifelse
  593.        -3 rmoveto
  594.           (label4) show
  595.           scientific notZero and
  596.           {
  597.              2 0 rmoveto
  598.              (x) show
  599.              1 0 rmoveto
  600.              (10) show
  601.              1 5 rmoveto
  602.              (exponent4) show
  603.           } if
  604.         1 scaleFactor scale
  605.     } if
  606.     
  607.     /notZero   (label5) (0) ne   def
  608.     numberOfLabels 5 ge
  609.     {
  610.        labelPlace firstLabel labelSpacing 4 mul add  moveto
  611.         1 unscaleFactor scale
  612.         labelPosition 1 eq 
  613.         {
  614.           (label5) stringwidth pop 
  615.            scientific notZero and {(x10   ) stringwidth pop add} if
  616.           neg
  617.        }
  618.        {0} ifelse
  619.        -3 rmoveto
  620.           (label5) show
  621.           scientific notZero and
  622.           {
  623.              2 0 rmoveto
  624.              (x) show
  625.              1 0 rmoveto
  626.              (10) show
  627.              1 5 rmoveto
  628.              (exponent5) show
  629.           } if
  630.         1 scaleFactor scale
  631.     } if
  632.     
  633.     /notZero   (label6) (0) ne   def
  634.     numberOfLabels 6 ge
  635.     {
  636.        labelPlace firstLabel labelSpacing 5 mul add  moveto
  637.         1 unscaleFactor scale
  638.         labelPosition 1 eq 
  639.         {
  640.           (label6) stringwidth pop 
  641.            scientific notZero and {(x10   ) stringwidth pop add} if
  642.           neg
  643.        }
  644.        {0} ifelse
  645.        -3 rmoveto
  646.           (label6) show
  647.           scientific notZero and
  648.           {
  649.              2 0 rmoveto
  650.              (x) show
  651.              1 0 rmoveto
  652.              (10) show
  653.              1 5 rmoveto
  654.              (exponent6) show
  655.           } if
  656.         1 scaleFactor scale
  657.     } if
  658.     
  659.     /notZero   (label7) (0) ne   def
  660.     numberOfLabels 7 ge
  661.     {
  662.        labelPlace firstLabel labelSpacing 6 mul add  moveto
  663.         1 unscaleFactor scale
  664.         labelPosition 1 eq 
  665.         {
  666.           (label7) stringwidth pop 
  667.            scientific notZero and {(x10   ) stringwidth pop add} if
  668.           neg
  669.        }
  670.        {0} ifelse
  671.        -3 rmoveto
  672.           (label7) show
  673.           scientific notZero and
  674.           {
  675.              2 0 rmoveto
  676.              (x) show
  677.              1 0 rmoveto
  678.              (10) show
  679.              1 5 rmoveto
  680.              (exponent7) show
  681.           } if
  682.         1 scaleFactor scale
  683.     } if
  684.     
  685.     /notZero   (label8) (0) ne   def
  686.     numberOfLabels 8 ge
  687.     {
  688.        labelPlace firstLabel labelSpacing 7 mul add  moveto
  689.         1 unscaleFactor scale
  690.         labelPosition 1 eq 
  691.         {
  692.           (label8) stringwidth pop 
  693.            scientific notZero and {(x10   ) stringwidth pop add} if
  694.           neg
  695.        }
  696.        {0} ifelse
  697.        -3 rmoveto
  698.           (label8) show
  699.           scientific notZero and
  700.           {
  701.              2 0 rmoveto
  702.              (x) show
  703.              1 0 rmoveto
  704.              (10) show
  705.              1 5 rmoveto
  706.              (exponent8) show
  707.           } if
  708.         1 scaleFactor scale
  709.     } if
  710.     
  711.     /notZero   (label9) (0) ne   def
  712.     numberOfLabels 9 ge
  713.     {
  714.        labelPlace firstLabel labelSpacing 8 mul add  moveto
  715.         1 unscaleFactor scale
  716.         labelPosition 1 eq 
  717.         {
  718.           (label9) stringwidth pop 
  719.            scientific notZero and {(x10   ) stringwidth pop add} if
  720.           neg
  721.        }
  722.        {0} ifelse
  723.        -3 rmoveto
  724.           (label9) show
  725.           scientific notZero and
  726.           {
  727.              2 0 rmoveto
  728.              (x) show
  729.              1 0 rmoveto
  730.              (10) show
  731.              1 5 rmoveto
  732.              (exponent9) show
  733.           } if
  734.         1 scaleFactor scale
  735.     } if
  736.     
  737.     /notZero   (label10) (0) ne   def
  738.     numberOfLabels 10 ge
  739.     {
  740.        labelPlace firstLabel labelSpacing 9 mul add  moveto
  741.         1 unscaleFactor scale
  742.            labelPosition 1 eq 
  743.            {
  744.              (label10) stringwidth pop 
  745.               scientific notZero and {(x10   ) stringwidth pop add} if
  746.              neg
  747.           }
  748.           {0} ifelse
  749.           -3 rmoveto
  750.           (label10) show
  751.           scientific notZero and
  752.           {
  753.              2 0 rmoveto
  754.              (x) show
  755.              1 0 rmoveto
  756.              (10) show
  757.              1 5 rmoveto
  758.              (exponent10) show
  759.           } if
  760.         1 scaleFactor scale
  761.     } if
  762.     
  763.     /notZero   (label11) (0) ne   def
  764.     numberOfLabels 11 ge
  765.     {
  766.        labelPlace firstLabel labelSpacing 10 mul add  moveto
  767.         1 unscaleFactor scale
  768.            labelPosition 1 eq 
  769.            {
  770.              (label11) stringwidth pop 
  771.               scientific notZero and {(x10   ) stringwidth pop add} if
  772.               notZero not {( ) stringwidth pop add} if             neg
  773.           }
  774.           {0} ifelse
  775.           -3 rmoveto
  776.           (label11) show
  777.           scientific notZero and
  778.           {
  779.              2 0 rmoveto
  780.              (x) show
  781.              1 0 rmoveto
  782.              (10) show
  783.              1 5 rmoveto
  784.              (1) show
  785.           } if
  786.         1 scaleFactor scale
  787.     } if
  788.     
  789. grestore
  790.  
  791. endps
  792.  
  793.  
  794.  
  795.